<?php

namespace App\Models;



class Article extends Orm
{
    /**
     * 关联到模型的数据表
     *
     * @var string
     */
    protected $table = 'articles';

    /**
     * 表明模型是否应该被打上时间戳
     *
     * @var bool
     */
    public $timestamps = true;
    protected $dateFormat = 'U';
    public $primaryKey = 'id';

    public function articleCat()
    {
        return $this->belongsTo(ArticleCat::class,'article_cat_id','id');
    }

    public function setImageAttribute($value)
    {
        $this->dealSetImageAttribute('image', $value);
    }

}
